﻿<UserControl x:Class="Weather.WeatherIcons.SomeClouds"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" RenderTransformOrigin="0.5,0.5"
             x:Name="this">
    <UserControl.RenderTransform>
        <ScaleTransform />
    </UserControl.RenderTransform>
    <UserControl.Resources>
        <Storyboard x:Key="FadeIn">
            <DoubleAnimation Storyboard.TargetName="BackgroundScale" Storyboard.TargetProperty="ScaleX" From="0.8" To="1" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="ForegroundScale" Storyboard.TargetProperty="ScaleX" From="0.8" To="1" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="BackgroundRotation" Storyboard.TargetProperty="Angle" From="25" To="-25" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="ForegroundRotation" Storyboard.TargetProperty="Angle" From="-50" To="0" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud1Translation" Storyboard.TargetProperty="X" From="-15" To="-55" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud1Scale" Storyboard.TargetProperty="ScaleX" From="0.55" To="0.6" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud2Translation" Storyboard.TargetProperty="X" From="40" To="70" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud2Scale" Storyboard.TargetProperty="ScaleX" From="0.55" To="0.6" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud1" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud2" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
        </Storyboard>
        <Storyboard x:Key="FadeOut">
            <DoubleAnimation Storyboard.TargetName="BackgroundScale" Storyboard.TargetProperty="ScaleX" From="1" To="0.8" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="ForegroundScale" Storyboard.TargetProperty="ScaleX" From="1" To="0.8" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="BackgroundRotation" Storyboard.TargetProperty="Angle" From="25" To="50" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="ForegroundRotation" Storyboard.TargetProperty="Angle" From="0" To="25" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud1Translation" Storyboard.TargetProperty="X" From="-55" To="-85" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.6"/>
            <DoubleAnimation Storyboard.TargetName="Cloud1Scale" Storyboard.TargetProperty="ScaleX" From="0.6" To="0.55" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud2Translation" Storyboard.TargetProperty="X" From="70" To="90" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.6"/>
            <DoubleAnimation Storyboard.TargetName="Cloud2Scale" Storyboard.TargetProperty="ScaleX" From="0.6" To="0.55" Duration="0:0:1.0" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud1" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.7" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Cloud2" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.7" AccelerationRatio="0.3" DecelerationRatio="0.3"/>
        </Storyboard>
    </UserControl.Resources>
    <Grid>
        <Image Name="BackgroundSun" Source="/UIFramework.Weather;Component/Images/weather_1.png" Opacity="0.7" RenderTransformOrigin="0.5,0.5">
            <Image.RenderTransform>
                <TransformGroup>
                    <RotateTransform x:Name="BackgroundRotation" Angle="0"/>
                    <ScaleTransform x:Name="BackgroundScale" ScaleX="1" ScaleY="{Binding ElementName=BackgroundScale, Path=ScaleX}"/>
                </TransformGroup>
            </Image.RenderTransform>
        </Image>
        <Image Name="ForegroundSun" Source="/UIFramework.Weather;Component/Images/weather_1.png" RenderTransformOrigin="0.5,0.5">
            <Image.RenderTransform>
                <TransformGroup>
                    <RotateTransform x:Name="ForegroundRotation" Angle="0"/>
                    <ScaleTransform x:Name="ForegroundScale" ScaleX="1" ScaleY="{Binding ElementName=ForegroundScale, Path=ScaleX}"/>
                </TransformGroup>
            </Image.RenderTransform>
        </Image>
        <Image Name="Cloud1" Source="/UIFramework.Weather;Component/Images/cloud_3.png" RenderTransformOrigin="0.5,0.5">
            <Image.RenderTransform>
                <TransformGroup>
                    <ScaleTransform x:Name="Cloud1Scale" ScaleX="0.6" ScaleY="{Binding ElementName=Cloud1Scale, Path=ScaleX}"/>
                    <TranslateTransform x:Name="Cloud1Translation" X="-55" Y="40"/>
                </TransformGroup>
            </Image.RenderTransform>
        </Image>
        <Image Name="Cloud2" Source="/UIFramework.Weather;Component/Images/cloud_1.png" RenderTransformOrigin="0.5,0.5">
            <Image.RenderTransform>
                <TransformGroup>
                    <ScaleTransform x:Name="Cloud2Scale" ScaleX="0.6" ScaleY="{Binding ElementName=Cloud2Scale, Path=ScaleX}"/>
                    <TranslateTransform x:Name="Cloud2Translation" X="60" Y="50"/>
                </TransformGroup>
            </Image.RenderTransform>
        </Image>
    </Grid>
</UserControl>
